#ifndef _LV_API_H_
#define _LV_API_H_

#include <stdexcept>
#include <vector>
#include <thread>
#include <lvmat.h>
#include <memory>

#include "VzenseNebula_api.h"

namespace lv::sdk
{

class LvApi
{
public:
    LvApi();
    ~LvApi();

    void init();
    uint32_t findDevice();
    void shutDown();
    VzDeviceInfo selectDevice(uint32_t idx);
    void startStream();
    void stopStream();
    void closeDevice();
    
    std::unique_ptr<lv::lvmat::LvMat> getFrameDepth();
    std::unique_ptr<lv::lvmat::LvMat> getFrameIR();
    std::unique_ptr<lv::lvmat::LvMat> getPointCloud(std::shared_ptr<lv::lvmat::LvMat> & src);
    
    void setIRGMMGain(uint8_t src);
    uint8_t getIRGMMGain();
    
    void setFrameRate(int src);
    int getFrameRate();

    VzExposureTimeParams getExposureTime();
    void setExposureTime(VzExposureControlMode mode, int exposureTime);
    
    void setExposureTimeMode(VzExposureControlMode mode);

    void setHDRMode(bool src);

    void setSpatialFilter(bool src);

    void setFillHoleEnable(bool src);

    void setTimeFilter(bool enable, int threshold);

    void setFlyingPixelFilter(bool enable, int threshold);

    void setConfidenceFilter(bool enable, int threshold);

    VzSensorExtrinsicParameters getSensorExtrinsicParameters();

public:
    std::vector<VzDeviceInfo>   m_infoList;
private:
    VzDeviceHandle              m_handle;
    VzSensorIntrinsicParameters m_camPara;

};

}


#endif